home *** CD-ROM | disk | FTP | other *** search
- Path: gramercy.ios.com!mdebiase
- From: mdebiase@gramercy.ios.com (Mark)
- Newsgroups: comp.databases.oracle,comp.lang.c++
- Subject: Re: Pro*C DB access routines with C++
- Followup-To: comp.databases.oracle,comp.lang.c++
- Date: 26 Feb 1996 02:58:47 GMT
- Organization: Internet Online Services
- Message-ID: <4gr7l7$9oh@news2.ios.com>
- References: <4g6vjv$gvv@news1.halcyon.com> <4gcf0c$e02@relay2.uk.mdis.com> <4gf5id$jec@boell.softcon.de>
- NNTP-Posting-Host: gramercy.ios.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Uwe Steffen (us@SoftcoN.de) wrote:
- : In article <4gcf0c$e02@relay2.uk.mdis.com>,
- : 100610.52@compuserve.com (Balakrishna Avula) writes:
- : >danubius@coho.halcyon.com () wrote:
- : >
- : >>I've been trying to find a book covering this subject to no avail so
- : >>far.
- : >
- : >>I have a C++ project that will need a bunch of Pro*C ORACLE DB access
- : >>routines. I'd like to wrap these routines in C++ classes, but being
- : >>fairly new at both, I could use some help from published books on this
- : >>subject, or example source code.
-
- : Hi,
- : it's a little bit tricky to start with, however solvable.
- : 1) You have to use PRO*C 1.6 instead of PRO*C 2.*, because
- : PRO*C 1.6 does not scan the entire file, only statements that
- : start with 'EXEC SQL'.
-
- Actually, Proc*C 2.0 in Oracle 7.1.4 and above can be used with option
- PARSE=NONE as this will cause the precompiler to work in text substitution
- mode like 1.6 (I believe this option was not available prior to 7.1.4).
-
- : 2) our .ec-files are called '*.ec', so we use the following rule to create
- : object-files:
- : .ec.o:
- : $(ESQL) INAME=$*.ec ONAME=$*.c $(ESQLFLAGS)
- : sed -f ../changec_C.sed $*.c >$*.C
- : $(RM) $*.EC
- : $(RM) $*.c
- : $(CC) -c $(FLAGS) $*.C
- : The sed-scripts does some postprocessing to correct
- : some incompatibilitys.
- : changec_C.sed:
- : 1,$s/char filnam\[.*\]/char filnam\[31\]/
- : /extern sqlcex(*/d
- : /extern sqlora(*/d
- : /extern sqlbuf(*/d
- : /extern sqlcte(*/d
- : /extern sqlcx2(*/d
- : /extern sqliem(*/d
- : You will have to put extern "C" { ... } -wrappers around function-
- : prototypes in oracle-headerfiles.
-
- : Good luck
- : Uwe Steffen
-
-
- Mark
-